<%--
  Created by IntelliJ IDEA.
  User: dzw
  Date: 2017/12/4
  Time: 16:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
  String jsessionid = session.getId();
%>
<form id="form_contractPerform_detail" class="panel-body form-horizontal form-padding">
  <input type="hidden" name="contractPerformId" id="contractPerformId" value="${parentId}"/>
  <input type="hidden" name="type" id="type" value="${type}"/>

  <div class="form-group">
    <label class="col-md-2 control-label">
      <c:if test="${type=='billing'}">开票日期</c:if>
      <c:if test="${type=='receipts'}">进款日期</c:if>
      <i class="fa fa-asterisk txt-color-red"></i></label>
    <div class="col-md-10">
      <input type="text" id="date" name="date" class="form-control">
    </div>
  </div>

  <div class="form-group">
    <label class="col-md-2 control-label">
      <c:if test="${type=='billing'}">开票金额</c:if>
      <c:if test="${type=='receipts'}">进款金额</c:if>
      <i class="fa fa-asterisk txt-color-red"></i></label>
    <div class="col-md-10">
      <input type="number" id="money" name="money" class="form-control">
    </div>
  </div>

</form>

<script>

  $('#date').datepicker({
    format: 'yyyy-mm-dd',
    weekStart: 1,
    autoclose: true,
    todayBtn: 'linked',
    todayHighlight: true,
    language: 'zh-CN'
  });

  function fn_task_feedback_save(callback) {
    var tmp = $("input#date").val();
    if(!tmp){
      __toastr_error("请选择日期！");
      return false;
    }

    var tmp2 = $("input#money").val();
    if(!tmp2){
      __toastr_error("请输入金额！");
      return false;
    }

    __form_save('form_contractPerform_detail', '<%=path%>/com/contractPerform/saveDetail',
            function(data){
              if(data.state == 1){
                callback(data);
              } else {
                callback();
              }
            }, function () {
              callback();
            });
  }

</script>
